// function submit_reply(r_id) {
// 	var saytext = $('#text_' + r_id).val();
// 	var reply_id = $('#reply_id_' + r_id).val();
// 	if(saytext) {
// 		$('#text_' + r_id).val('');
// 		$.getScript('/#comment?c=' + encodeURIComponent(saytext) + '&rid=' + reply_id + '&_' +(new Date()).getTime(),function() {})
// 	} else {
// 		alert('请输入内容~');
// 	}
// }
function reply(nick)
{
	var comm_con	= $("#comment");
	var comm	= comm_con.find('textarea');
	if (comm.length > 0)
	{
		comm.focus();
		comm.val('@' + nick + ':');
	}
	else
	{
		document.location="#comment";
	}
	
}
function submit_comment() {
	var saytext = $('#cp_com_textarea').val();
	var cp_id = $('#cp_id').val();
	var cp_com_type = $('#cp_com_type').val();
	if(saytext) {
		$('#cp_com_textarea').val('');
		$('#cp_com_textarea').keyup();
		$('#cp_com_type').val(0);
		params	= '&type=' + cp_com_type + '&id=' + cp_id + '&comment=' + encodeURIComponent(saytext);
		$.ajax({
			type : 'post',
			url : '/comment/ajaxaddComment',
			data : params,
			dataType : 'json',
			success : function(msg) 
			{
				if (msg.status == "OK")
				{
					window.location.reload();
				}
				else
				{
					if (msg.status == "NoLogin") {
						logindialog();
					}else{
						alert('评论失败，请重试~');
					};
				}
			}
		});
	} else {
		alert('请输入内容~');
	}
}
function get_more_pl(id,page){
	$('#newspls').html("<p style=\"text-align:center;padding:30px 0;\"><img src=\"/static/img/loading.gif\" border=0 /></p>");
	location.href = '#newspls';
	$.get('/comment/ajax_more/?type=caipu&id=' + id + '&page=' + page, null,
	function(data) {
		if(data != '') {
			$('#newspls').html(data);
			bind_re();
		}
	})
}


function delcomment(commentid,type)
{
	if (commentid == '' || type == '')
	{
		return false;
	}
	params	= '&commentid=' + commentid + '&type=' + type;
	$.fn.confirm({
		msg:'确定删除这条评论信息？',
		callback:function(){
			$.ajax({
				type:"post",
				url:"/comment/ajaxdelCommend",
				data:params,
				dataType:"json",
				async: false,
				success: function(msg)
				{
					if(msg.data.info == 'NoLogin')
					{
						logindialog();
					}else if(msg.data.info == 'OK')
					{
						window.location.reload();
					}else
					{
						showerrorinfo('操作错误', '删除失败，请重试！');
					}
				}
			})
		}
	})
}